package JasPerl::TagExt::JspBodyTag;

use strict;
use warnings;

use parent qw(JasPerl::TagExt::JspTag);

sub get_jsp_body {
    return $_[0]->{jsp_body};
}

sub set_jsp_body {
    $_[0]->{jsp_body} = $_[1];
}

sub do_body {
    my ($self, $out) = @_;
    if (my $body = $self->get_jsp_body()) {
        $body->invoke($out);
    }
}

sub do_tag {
    $_[0]->do_body();
}

# deprecated
sub get_body_content {
    use JasPerl::TagExt::BodyContent;

    my $self = shift;
    my $body = JasPerl::TagExt::BodyContent->new();
    $self->do_body($body);
    return $body->trim();
}

1;
